package core.actions;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Anton
 * Used by the ActionSet
 */
public class ActionInfo {
	private Action action;
	private boolean isBought;
	private List<ActionInfo> linkedActions;
	private List<String> actionsToBeLinked;
	
	public ActionInfo(Action action, List<String> actionsToBeLinked){
		setAction(action);
		setActionsToBeLinked(actionsToBeLinked);
	}
	public ActionInfo(Action action, String[] actionsToBeLinked){
		setAction(action);
		setActionsToBeLinked(actionsToBeLinked);
	}
	
	public void setActionsToBeLinked(List<String> actionNames){
		actionsToBeLinked=actionNames;
	}
	public void setActionsToBeLinked(String[] actionNames){
		for(String s : actionNames)
			actionsToBeLinked.add(s);
	}
	public void setLinkedActions(List<ActionInfo> actions){
		linkedActions=actions;
	}
	public Action getAction() {
		return action;
	}
	public void setAction(Action action) {
		this.action = action;
	}
	public boolean isBought() {
		return isBought;
	}
	public void setBought(boolean isBought) {
		this.isBought = isBought;
	}
	public List<ActionInfo> getLinkedActions() {
		return linkedActions;
	}
	public List<String> getActionsToBeLinked() {
		return actionsToBeLinked;
	}
	
	public String toString(){
		return action.toString()+", linked to: "+actionsToBeLinked.toString()+"("+linkedActions.size()+")";
	}
}
